<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%@include file="/common/common.jsp" %>
<%@ page import="com.chanyachting.emall.domain.Member" %>
<%@ page import="com.chanyachting.emall.util.*" %>
<%@ page import="com.chanyachting.emall.service.MemberService" %>
<%@ page import="java.util.*" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" /> 
<meta name="description" content="" />
<link href="css/import.css" type="text/css" rel="stylesheet" />
<title></title>
</head>

<%

	//从session 中获得会员对象

	RequestUtil ru=new RequestUtil(request);
	
	Member member=(Member)ru.getSessionObject(MemberService.MEMBER_IN_SESSION,new Member());
	
	String birthday=member.getMemberBirthday();
	
	//拆分会员生日，拆分成 年，月，日  3个变量
	String temp []=StringUtil.toArray(birthday);
	
	String year=temp[0];
	String month=temp[1];
	String day=temp[2];
	
%>

<body>

<%@ include file="memberInfoMenu.jsp" %>

<div><%= new RequestUtil(request).getMsg() %></div>

<form id="form1" name="form1" method="post" action="<%=root %>/memberBackend/updateInfo.do" enctype="multipart/form-data">
  <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="400"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="100" height="28" align="right">用户名：</td>
            <td><label>
              <input name="memberName" type="text" id="textfield8" value="<%= member.getMemberName() %>" />
            </label></td>
          </tr>
          <tr>
            <td height="28" align="right">邮件地址：</td>
            <td><label>
              <input name="email" type="text" id="textfield9" value="<%= member.getEmail() %>" />
            </label></td>
          </tr>
          <tr>
            <td height="28" align="right">性别：</td>
            <td><label>
              <select name="sex" id="select">
               <%
					Iterator  sex=CodeMap.sex.keySet().iterator();
				
					while(sex.hasNext()){
						
						String key=sex.next().toString();
						
						String value=CodeMap.sex.get(key).toString();
				%>
				<option value="<%=key %>" <%= member.getSex().equals(key)?"selected":"" %>><%=value %></option>
				<%
					}
				%>	
              </select>
            </label></td>
          </tr>
          <tr>
            <td height="28" align="right">生日：</td>
            <td><label>
            
             <select name="selectYear">
             <%
             	for(int i=1960;i<2019;i++){
             		
             %>
             	<option value="<%=i %>" <%= String.valueOf(i).equals(year)?"selected":"" %>><%=i %></option>
             <%		
             		
             	}
             %>
             
             </select>
              
              <select name="selectMonth">
              <%
             	for(int i=1;i<13;i++){
             		
             %>
             	<option value="<%=i %>" <%= String.valueOf(i).equals(month)?"selected":"" %>><%=i %></option>
             <%		
             		
             	}
             %>
              
              </select>
			
              <select name="selectDay">
              <%
             	for(int i=1;i<32;i++){
             		
             %>
             	<option value="<%=i %>" <%= String.valueOf(i).equals(day)?"selected":"" %>><%=i %></option>
             <%		
             		
             	}
             %>
              </select>
              
            </label></td>
          </tr>
          <tr>
            <td height="28" align="right">行业：</td>
            <td><label>
              <select name="jobType" id="select3">
              	<%
					Iterator  businessType=CodeMap.businessType.keySet().iterator();
				
					while(businessType.hasNext()){
						
						String key=businessType.next().toString();
						
						String value=CodeMap.businessType.get(key).toString();
				%>
				<option value="<%=key %>" <%= member.getJobType().equals(key)?"selected":"" %>><%=value %></option>
				<%
					}
				%>
               </select>
            </label></td>
          </tr>
          <tr>
            <td height="28" align="right">州/省：</td>
            <td><label>
              <select name="area" id="select4">
                <%
					Iterator  toJobArea=CodeMap.toJobArea.keySet().iterator();
				
					while(toJobArea.hasNext()){
						
						String key=toJobArea.next().toString();
						
						String value=CodeMap.toJobArea.get(key).toString();
				%>
				<option value="<%=key %>" <%= member.getArea().equals(key)?"selected":"" %>><%=value %></option>
				<%
					}
				%>	
              </select>
            </label></td>
          </tr>
          <tr>
            <td height="28" align="right">职业：</td>
            <td><label>
              <input type="text" name="job" id="job" value="<%= member.getJob() %>" />
            </label></td>
          </tr>
          <tr>
            <td height="28" align="right"> 在线联系 ：</td>
            <td><label>
              <input type="text" name="webContact" id="textfield11" value="<%= member.getWebContact() %>" />
            </label></td>
          </tr>
          <tr>
            <td height="28" align="right">备用邮件：</td>
            <td><label>
              <input type="text" name="backupEmail" id="textfield" value="<%= member.getBackupEmail() %>"/>
            </label></td>
          </tr>
          <tr>
            <td height="28" align="right">个人主页：</td>
            <td><label>
              <input type="text" name="blog" id="textfield12" value="<%= member.getBlog() %>" />
            </label></td>
          </tr>
      </table></td>
      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="180"><img src="<%=member.getImgUrl() %>" class="pp_img" /></td>
          </tr>
          <tr>
            <td>上传个人图片
              <label>
                <input type="file" name="file" id="fileField" />
              </label></td>
          </tr>
      </table></td>
    </tr>
  </table>
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="td_updown">
    <tr>
      <td height="40" align="center">
      	<input type="submit" name="button" id="button" value="提交" />
        <input type="reset"  name="button" id="button2" value="取消" /></td>
    </tr>
  </table>
</form>
</body>
</html>

